/**
@author		Jong Min, Lee
@date		  02/10/2014
@breif		contains utility marco

copyright(c) Tae Young Soft. All right reserved. 2014
*/
#pragma once

#define DISALLOW_COPY_AND_ASSIGN(TypeName) \
  TypeName(const TypeName&);               \
  void operator=(const TypeName&)

#define _TRY_ALLOC(v, f) \
  try\
{\
  (v) = new (f);\
}\
  catch(CException* e)\
{\
  e->Delete();\
  (v) = NULL;\
}\
  catch(...) \
{\
  v = 0;\
}

#define _DELETE(p)\
  if((p) != NULL)\
  {\
  delete (p);\
  (p) = NULL;\
  }

#define _DELETE_ARR(p)\
  if((p) != NULL)\
  {\
  delete[] (p);\
  (p) = NULL;\
  }

#define _DELETE_WND(p)\
  if((p) != NULL)\
  {\
  if(::IsWindow((p)->GetSafeHwnd()))\
  (p)->DestroyWindow();\
  delete (p);\
  }

#define round(a)  (int((a)+0.5))
